home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
misc
/
football
/
user
/
viewscheduleandresults.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-11-29
|
4KB
|
174 lines
/* Mode=Run */
/* ***********************************************************************
VIEW SCHEDULE PROGRAM FOR FOOTBALL REXX SUITE
-----------------------------------------------
Copyright Mark Naughton 1997
Version Date History
--------------------------------------------------------------------------
1.0 150997 First release.
151297 Tidied display.
180499 Amended display, in line with Results.
250499 And again.
250899 Added error msg for file checks.
110999 Converted to use locale. Some error messages, before
reading the locale, will still be in English.
**************************************************************************
Procedure
---------
1. Check files exist.
2. Open '.df' file and get the schedule definition file. Set marker.
3. If no file specified, then exit, giving an error.
2. Open file and print all lines without '*' with the exception of
the league name, weeks and dates which are underlined.
3. Close file and exit.
************************************************************************** */
PARSE ARG league_file
version = 1
league_file = "Data/" || league_file
input_file = '.sf'
input2_file = '.df'
autosched = '*AUTOSCHD='
separator = '*'
if open(datafile,"Data/Football.locale",'r') then do
line = readln(datafile)
locdir = strip(line)
close(datafile)
end
else do
say
say "ERROR : (ViewScheduleAndResults)"
say
say "Cannot read 'Data/Football.locale' for the locale settings."
exit
end
locdir = locdir"User/ViewScheduleAndResults.data"
if open(datafile,"ENV:FootballRXPath",'r') then do
line = readln(datafile)
rxdir = strip(line)
close(datafile)
end
else
rxdir = "SYS:Rexxc/"
if exists(locdir) > 0 then do
address command rxdir'rx 'locdir
VarCount = getclip('VarCount')
do i = 1 to VarCount
interpret getclip('var.'i)
end
end
else do
say
say "ERROR : (ViewScheduleAndResults)"
say
say "Cannot find '"locdir"' to read locale settings."
exit
end
if exists(league_file || input_file) = 0 then do
say
say vsar_error
say
say vsar_t1"'"league_file || input_file"'."
exit
end
if exists(league_file || input2_file) = 0 then do
say
say vsar_error
say
say vsar_t1"'"league_file || input2_file"'."
exit
end
autos = 0
if open(datafile,league_file || input2_file,'r') then do
do while ~eof(datafile)
line = readln(datafile)
if pos(autosched,line) > 0 then do
autofile = delstr(line,1,10)
autos = 1
end
end
close(datafile)
end
else do
say
say vsar_error
say
say vsar_t2"'"league_file||input2_file"'"vsar_t3
exit
end
if autos = 0 then do
say
say vsar_error
say
say vsar_t4
say vsar_t5
say vsar_t6
say
exit
end
if open(datafile,league_file || input_file,'r') then do
say
say center(vsar_t7,78)
say "-------------------------------------------------------------------------------"
say
say vsar_t8" '"autofile"' "vsar_t9
say
do while ~eof(datafile)
line = readln(datafile)
if pos(separator,line) = 0 then do
t1 = right(strip(substr(line,1,30)),30,' ')
say t1||substr(line,31)
end
else do
if words(line) > 1 then do
if pos("*Week",line) > 0 then do
chas = subword(line,2)
do mm=1 to length(chas)
if substr(chas,mm,1) = "0" then
chas = overlay(" ",chas,mm,1)
else
leave
end
chas = vsar_t10" "strip(chas)
end
else
chas = subword(line,2)
say chas
uline = ''
do i=1 to length(chas)
uline = insert('-',uline,i,1)
end
say strip(uline)
end
else
if words(line) = 1 then
say
end
end
say "-------------------------------------------------------------------------------"
close(datafile)
end
else do
say
say vsar_error
say
say vsar_t2"'"league_file||input_file"'"vsar_t3
end
exit